package com.naiterui.ehp.bs.patient.controller;

import com.naiterui.common.repository.page.PageParamVO;
import com.naiterui.common.repository.page.PageVO;
import com.naiterui.ehp.bp.bo.notice.NoticeMessageBO;
import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bs.patient.service.INoticeMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * @author luao
 * @date 2021/3/9 6:43 下午
 **/
@Api(tags = SwaggerTag.PATIENT + SwaggerTag.NOTICE_DYNAMICS)
@RestController
@RequestMapping("/ap/notice/message")
@RequiredArgsConstructor
@Validated
public class ApNoticeMessageController {
    private final INoticeMessageService notificationService;

    @ApiOperation(value = "院务公开列表")
    @GetMapping("/list")
    public PageVO<NoticeMessageBO> list(PageParamVO page){
        return notificationService.list(page);
    }

    @ApiOperation(value = "院务公开详情")
    @GetMapping("/{id}")
    public NoticeMessageBO detail(@NotNull(message = "id不能为空") @PathVariable Long id){
        return notificationService.detail(id);
    }
}
